-
Notifications
You must be signed in to change notification settings - Fork 10
Enable checkpoint restart for OutHDF5 #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
The9Cat
wants to merge
8
commits into
devel
Choose a base branch
from
RestartFixHDF5
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Enables OutHDF5 to restart correctly in checkpoint mode by skipping snapshot enumeration and instead targeting the existing checkpoint file/directory.
Changes:
- Use
checkpoint_<runtag>(file or directory) as the restart target whencheckpt=true. - Skip the snapshot file/directory enumeration loop when
checkpt=true. - Avoid broadcasting
nbegin checkpoint mode since snapshot indexing is not used.
Comments suppressed due to low confidence (1)
src/OutHDF5.cc:208
- The runtime_error messages thrown here say
Component::initialize error, but this code is inOutHDF5::initialize(). With the new checkpoint-path logic, these errors can be triggered in checkpoint mode as well, so the message becomes more misleading. Update the prefix toOutHDF5::initialize(and consider including whether this was snapshot vs checkpoint mode).
if (not std::filesystem::is_directory(dir_path)) {
throw std::runtime_error("Component::initialize error: you specified directory organization of output but the directory " + dir_path.string() + " does not exist");
}
}
else {
std::ostringstream fname;
if (chkpt)
fname << outdir
<< "checkpoint_" << runtag << ".1";
else
fname << outdir
<< filename << "_" << setw(5) << setfill('0') << nbeg
<< ".1";
std::filesystem::path file_path = fname.str();
if (not std::filesystem::is_regular_file(file_path)) {
throw std::runtime_error("Component::initialize error: you specified file organization of output but the file " + fname.str() + " does not exist");
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Fix checkpoint restart file check for single-process runs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue
On restart,
OutHDF5looks for enumerated snapshot files or directories independent ofcheckptThe fix
Bypass enumeration check if
checkpt=trueand use the existing checkpoint file or directory.